﻿<Window x:Class="PluginSettingsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
    xmlns:Commands="clr-namespace:iConverter.Commands" 
    Title="插件设置" Height="480" Width="640" Icon="Images\Settings_32x32.png" 
    ShowInTaskbar="False"     ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterOwner">

    <Window.Resources>
        <LinearGradientBrush x:Key="SeparatorBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#00D2D3D4" Offset="1" />
            <GradientStop Color="#7FD2D3D4" />
            <GradientStop Color="#FFD2D3D4" Offset="0.246" />
            <GradientStop Color="#FFD2D3D4" Offset="0.797" />
        </LinearGradientBrush>
        <Style x:Key="OptionLabelStyle" TargetType="{x:Type Label}">
            <Setter Property="Control.FontSize" Value="14" />
            <Setter Property="Control.FontWeight" Value="Bold" />
            <Setter Property="Control.Background" Value="AliceBlue" />
        </Style>


    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="132" />
            <ColumnDefinition Width="486*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Border x:Name="ProviderInfo" BorderThickness="1" Margin="6,6,0,0" BorderBrush="{StaticResource SeparatorBorderBrush}" Grid.Row="0" Grid.Column="0"
                DataContext="{Binding Provider}" >
            <StackPanel>

                <Image    x:Name="imgIcon"  Stretch="Uniform" Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center"  Margin="0,20,0,20" 
                                    Source="{Binding Path=Icon, Mode=OneWay}"/>

                <TextBlock  x:Name="txtName"  Text="{Binding Path=Name, Mode=OneWay}" FontWeight="Bold" VerticalAlignment="Center"  />

                <TextBlock    Text="版本：" VerticalAlignment="Center"  />
                <TextBlock x:Name="txtVersion" Text="{Binding Mode=OneWay, Path=Version}" />

                <TextBlock    Text="作者："  VerticalAlignment="Center"  />
                <TextBlock x:Name="txtAuthor" Text="{Binding Mode=OneWay, Path=Author}" />


                <TextBlock x:Name="txtDescription"   Text="{Binding Mode=OneWay, Path=Description}" 
                            TextTrimming="WordEllipsis" TextWrapping="Wrap" />


            </StackPanel>            
        </Border>
        
        <Border x:Name="SettingsPanel" BorderThickness="1" Margin="0,6,6,0" BorderBrush="{StaticResource SeparatorBorderBrush}" Grid.Row="0" Grid.Column="2"
               >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                
                <Label  Grid.Row="0"   Content="插件设置" Style="{StaticResource OptionLabelStyle}"  />
                <ScrollViewer x:Name="SettingsView" 
                              Margin="3" VerticalScrollBarVisibility="Auto" 
                              Grid.Row="1" 
                              Content="{Binding Path=Configurator,Mode=OneWay}"
                                DataContext="{Binding CurrentSettings}" >

                </ScrollViewer>
            </Grid>
        </Border>

        <StackPanel Grid.Row="1" Orientation="Horizontal"  HorizontalAlignment="Right" Margin="0,3,10,3" Grid.Column="1">
            <Button x:Name="btnReset" Content="重置设置"  Margin="10,0,130,0"   Width="100" Command="Commands:PluginSettingsCommands.ResetCommand"  />
            
            <Button x:Name="btnOK" Content="确定" IsDefault="True" Margin="10,0,10,0"   Width="100" Command="Commands:PluginSettingsCommands.OKCommand"  />
            <Button x:Name="btnCancel" Content="取消" IsCancel="True"   Margin="10,0,10,0"   Width="100"  Command="Commands:PluginSettingsCommands.CancelCommand"/>
        </StackPanel>

    </Grid>


</Window>
